@extends('layouts.default')
@section('content')
            <div class="box">
                <header>
                    <div class="icons">
                        <i class="fa fa-table"></i>
                    </div>
                    <h5>{{ $make.' '.$model}} {{ Lang::get('messages.repair_head') }}</h5>
                    <div class="toolbar"> 
                        {{ Helpers\Helper::fa_link_to_action(
                                    'glyphicon glyphicon-plus',
                                    'RepairController@create',
                                     Lang::get('messages.add_btn'),$car_id, array( 
                                    'class'=>'btn btn-success btn-sm btn-round')) 
                        }}         
                    </div>
                </header><br/>
                <table id="dataTable"  style="width:100%" class="table table-bordered table-condensed table-hover table-striped">
                    <thead style="width:100%">
                        <tr>
                            <th>{{Lang::get('messages.repair')}}</th>
                            <th>{{Lang::get('messages.price')}}</th>
                            <th>{{Lang::get('messages.date')}}</th>                     
                            <th>{{Lang::get('messages.nr_invoice')}}</th>
                            <th>{{Lang::get('messages.user')}}</th>
                            <th>{{Lang::get('messages.service')}}</th> 
                            <th>{{Lang::get('messages.action')}}</th> 
                            <th>{{Lang::get('messages.info')}}</th> 
                        </tr>
                    </thead>
                    <tbody  style="width:100%">                          
                        @foreach ($repairs as $r)
                        <tr> 
                            <td>{{ Lang::get('repair.'.$r->repair) }}</td>    
                            <td>{{ number_format($r->price,2).' '.$r->currency}}</td>
                            <td>{{ $r->repair_date}}</td> 
                            <td>{{ $r->nr_invoice}}</td>
                            <td>{{ $r->first_name}}</td>    
                            <td>{{ $r->name}}</td>   
                            <td>{{ Helpers\Helper::fa_link_to_action(
                                    'glyphicon glyphicon-edit',
                                    'RepairController@edit_repair',
                                     Lang::get('messages.edit_btn'),
                                     $r->repair_id, array( 
                                    'class'=>'btn btn-success btn-xs btn-round')) 
                                }} 
                                {{ Helpers\Helper::fa_link_to_action(
                                    'glyphicon glyphicon-trash',
                                    'RepairController@destroy_repair',
                                     Lang::get('messages.delete_btn'),
                                     $r->repair_id, array( 
                                    'class'=>'btn btn-danger btn-xs btn-round delete',
                                    'data-confirm'=>Lang::get('messages.confirm_delete'))) 
                                }}
                                {{ Helpers\Helper::modal(Lang::get('messages.modal_confirm'),
                                    Lang::get("messages.close_btn"),Lang::get("messages.ok_btn"),
                                    'dataConfirmOK')
                                }}
                            </td> 
                            <td><a title="{{isset($r->comment)?$r->comment:''}}" >More...</a></td>
                        </tr>                            
                        @endforeach 
                    </tbody>
                   
                </table>
                 
            </div>
@stop
